import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: wwy
 * Date: 2024-11-10
 * Time: 15:05
 */
public class Test8 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNextInt()) {
            int n = sc.nextInt();
            int c = 0;
            while (n != 0) {
                n = n & (n - 1);
                c++;
            }
            System.out.println(c);
        }
    }
}
